home *** CD-ROM | disk | FTP | other *** search
- /*
- File: BlockDriverPriv.h
-
- Contains: xxx put contents here xxx
-
- Version: xxx put version here xxx
-
- Copyright: © 1998 by Apple Computer, Inc., all rights reserved.
-
- */
-
-
- #ifndef __BLOCKDRIVERPRIVH__
- #define __BLOCKDRIVERPRIVH__
-
- #include <MacTypes.h>
- #include <Disks.h>
-
- enum {
- // kCDBSize = 12,
- kSenseDataSize = 18
- };
-
-
- enum {
- kCmdFormat = 0x04,
- kCmdInquiry = 0x12,
- kCmdModeSelect = 0x55,
- kCmdModeSense = 0x5A,
- kCmdPreventAllowRemoval = 0x1E,
- kCmdRead = 0x28,
- kCmdReadCapacity = 0x25,
- kCmdReadFormatCapacities = 0x23,
- kCmdRequestSense = 0x03,
- kCmdRezero = 0x01,
- kCmdSeek = 0x2B,
- kCmdSendDiagnostic = 0x1D,
- kCmdStartStopUnit = 0x1B,
- kCmdTestUnitReady = 0x00,
- kCmdWrite = 0x2A,
- kCmdWriteVerify = 0x2E,
- kCmdVerify = 0x2F
- };
-
- typedef struct ReadCapacityData {
- UInt32 lastLogicalBlock; // Last valid LBA
- UInt32 blockLength; // Block length in bytes
- } ReadCapacityData, *ReadCapacityDataPtr;
-
- // This structure defines each volume (partition) on a physical drive (media)
- struct VolumeRec // This is needed to support multiple partitions
- {
- DrvSts2 driveStatus; // drive status info & queue element
- UInt16 vRefNum; // drive number for this volume
- Boolean mountthispart; // mount this volume indicator
- Boolean partmounted; // volume mounted indicator
- UInt32 partitionNo; // the partition number for the volume
- UInt32 partoffset; // phys. offset of data partition
- UInt32 curoffset; // 0 = physical mapping, else 'partoffset'
- UInt32 partblks; // number of blocks in the partition
- Ptr nextVol; // Link to next volume in the list
- Ptr drivePtr; // Pointer to the owning drive's record
- Ptr mediaIconPtr; // Pointer to the media icon for this volume
- };
-
- typedef struct VolumeRec VolumeRec, *VolumeRecPtr;
-
- // Device location icon/string structure format
- struct DriverLocationIcon {
- SInt8 ataLocationIcon[256]; // ICN# data is 256 bytes
- Str255 ataLocationString; // returned in C string format
- };
- typedef struct DriverLocationIcon DriverLocationIcon;
-
- // This structure defines each physical drive…
- struct DriveRec
- {
- UInt32 capacity; // Drive capacity in blocks
- UInt32 blockSize;
- Boolean inSleepMode; // true = drive is in sleep mode (needs reset to access)
- Boolean doSpindown; // true = driver manages drive's spindown timer
- Boolean isSpunDown; // true = drive is not spinning (low power mode)
- UInt8 busState; // Drive's bus state (not present, offline, online)
- UInt16 numVolumes; // Number of partitions in the drive
- VolumeRecPtr nextVol; // Pointer to drive's volume list
- SInt16 modelNo[8]; // First 16 bytes of the model string
- SInt16 fwRevision[2]; // First 4 bytes of the F/W revision string
- };
-
- typedef struct DriveRec DriveRec, *DriveRecPtr;
-
- enum { // Values for 'busState'
- kNOT_PRESENT = 0, // Drive is off the bus, and not known by system
- kOFFLINE = 1, // Drive off the bus, but has volumes mounted
- kONLINE = 2 // Drive on bus and the system knows it
- };
-
- #endif //__BLOCKDRIVERPRIVH__
-